home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / UTILITY / DO1002.ARJ / SUBST.SCR < prev    next >
Text File  |  1991-12-03  |  949b  |  29 lines

  1. .pg wi full clr cy
  2.     COMMAND NAME»gray«: »%t« SubstituteString »ye«
  3.  
  4.     /SUBST {variable} {string} {target} {phrase} [{start}]
  5. /cw
  6.     Substitutes »cy«{phrase}»#« for every occurance of »cy«{phrase}»#« in
  7.     »cy«{string}»#« and places the result in »cy«{variable}»#«.
  8.  
  9.     If the optional »cy«{start}»#« position is entered. »%t«DO»#« starts the
  10.     search at that position.  If found, the target is changed and the
  11.     »ye«absolute position»#« in »cy«{string}»#« is returned in the variable »gr«STRPOS»#«.
  12.  
  13.     Here are some examples:
  14.  
  15. |/SUBST Result "Test of Substitute String" "Substitute " »bo«Substitute»#«
  16.  
  17.    Result: "%Result" , Strpos: %StrPos(###)
  18.    Notice that you can substitute configuration variables in strings.
  19.  
  20. |/SUBST Result 123456789 4 "here it is" 2
  21.  
  22.    Result: "%Result" , Strpos: %StrPos(###)
  23.  
  24. |/SUBST Result 123456789 2 "not here" 3
  25.  
  26.    Result: "%Result" , Strpos: %StrPos(###)
  27.  
  28. /ENDEXEC CLEAR
  29.